-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add detailed counters to track database perf #2010
Add detailed counters to track database perf #2010
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
12f554a
to
58fcb42
Compare
@@ -938,6 +983,20 @@ impl Store { | |||
cached_count: u64, | |||
units: u64, | |||
) -> Result<Vec<HubEvent>, HubError> { | |||
// TODO: uncomment this code and monitor in production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to combine multiple changes in same commit / PR. After merge and monitoring is in place I recommend uncommenting this. If this PR is not going to be merged I recommend making this change as benchmarking showed it massively improves performance. There might be an issue with large prune jobs blocking merges so increasing FID_LOCKS_COUNT
might be good to ensure there isn't an unnecessary lock conflict.
Exposes prometheus scrape endpoint at /v0/metrics. Runtime overhead is very minimal as we're simply updating a few atomic counters on each call.
58fcb42
to
f350876
Compare
Closing due to age, and not actively being pursued. Thanks for the work here! We'll pick this back up at some point. |
Exposes prometheus scrape endpoint at /v0/metrics. Runtime overhead is very minimal as we're simply updating a few atomic counters on each call.
Motivation
Currently difficult to see if performance blips in production are due to database slow downs, lock contentions, thread pool queue, or other parts of the code. Having detailed counters allows for easy investigations.
Change Summary
Add metrics module in
addon
. Metric counters use Atomic numbers and should have very minimal runtime overhead.Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewAdditional Context
If this is a relatively large or complex change, provide more details here that will help reviewers
PR-Codex overview
This PR updates the codebase to introduce a new
metrics
module, addsCounters
functionality for tracking store actions, and refactors store definitions.Detailed summary
metrics
module andCounters
functionality for tracking store actions.statsd
withmetrics
.rsCountersString
function.